﻿@model IEnumerable<Qu.ComputingContest.Model.ScheduleItem>

@if (Model.Count() == 1 && !Model.ElementAt(0).IsContestOn.Value)
{
   <script>
       $(document).ready(function() {
           $(".page").replaceWith("<div class='fullscreenDiv'><h1 id='titleDiv' class='center'>@Html.Raw(Model.ElementAt(0).Title)</h1></div>");
           $("#titleDiv").letterfx({ "fx": "fly-right fly-bottom spin" });

           setTimeout(function () {
               $('#titleDiv').letterfx({ "fx": "fly-right fly-bottom spin" });
           }, 200);
       })
   </script>

    
    return;
}

<div style="padding-top: 20px;"></div>
<table class="stripe" width="100%">
@if (Model.Where(si => si.IsContestOn.Value).Count() > 0)
{
    <tr>
        <th colspan="2">
        </th>
        @for (int i = 1; i <= 8; i++)
        {
            <th>
                A<small>@i</small>
            </th>
        }
    </tr>
}

@foreach (var item in Model) {
    if (item.IsContestOn.Value)
    {
    <tr class="spaceUnder">
        <td style="text-align: left; font-size:40px; padding-left:0px; padding-right:0px;">
            @Html.DisplayFor(modelItem => item.TimeSlot)
        </td>
        <td style="font-size:50px;padding-left:0px; padding-right:0px;" >
            @Html.DisplayFor(modelItem => item.StartAt)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Track1)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Track2)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Track3)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Track4)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Track5)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Track6)
        </td>
      <td>
            @Html.DisplayFor(modelItem => item.Track7)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Track8)
        </td>
    </tr>
    }
    else
    {
        <tr>
            <td colspan="12">
                <div class="tagline">
                     @Html.Raw(item.Title)
                </div>
            </td>
        </tr>
    }
}

</table>
